package puppy.eval.logloaders;

import java.util.ArrayList;
import java.util.Hashtable;

import util.io.TextFileLoader;

public class FeaturesLoader {

	/**
	 * @param args
	 */
	
	
	public static  Hashtable<String,ArrayList<String>> loadQueryTagsFeatures(String path){
		
		TextFileLoader in = new TextFileLoader(path);
		Hashtable<String,ArrayList<String>> query_tags = new Hashtable<String,ArrayList<String>>();
		while(in.hasNext()){
			
			String line[] = in.next();
			if(line.length<2) continue;
			
			String query = line[0];
			//System.out.println(line[0]+ "\t"+ line.length);
			String tag= line[1];
			
			updateHash(query,tag);
			
			if(query_tags.containsKey(query)){
				
				ArrayList<String> a = query_tags.get(query);
				a.add(tag);
				query_tags.put(query, a);
			}else{
				
				ArrayList<String> a = new ArrayList<String>();
				a.add(tag);
				query_tags.put(query, a);
				
			}
			
		}
		
		return query_tags;
	}
	private static  void updateHash(String query, String tag) {
		// TODO Auto-generated method stub
		
		
		
		
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
